home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 6_1.lha / 6_1 / tst1.c < prev    next >
Text File  |  1993-08-08  |  596b  |  35 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. include <strclass.h>
  6.  
  7. ifdef A
  8. include <6_1a1b.c>
  9. else
  10. include <6_1a2b.c>
  11. include <6_1a2c.c>
  12. endif
  13.  
  14. ain()
  15.  
  16.    string x[100];
  17.    cout << "here we go\n";
  18.    for (int n = 0; cin>>x[n]; n++)
  19. {
  20. string y;
  21. if (n == 100) error("too many strings");
  22. cout << (y = x[n]);
  23. if (y == "done") break;
  24. }
  25.    cout << "here we go back again\n";
  26.    for (int i = n-1; 0 <= i; i--)
  27. cout << x[i];
  28.    for (i = n-1; 0 <= i; i--)
  29. {
  30. outputstring(x[i]);
  31. cout << "\n";
  32. }
  33.    return 0;
  34.  
  35.